import mongoose  from 'mongoose'
import BaseModel from "./base_model"

let Schema    = mongoose.Schema;
let ObjectId  = Schema.ObjectId;

var RepoSchema = new Schema({
  gitLogin:        { type: String, default: '未同步名字' },
  gitName:         { type: String, default: '未同步名字' },
  gitAvatarUrl:    { type: String, default: '未同步名字' },
  name:            { type: String, default: '未同步名字' },
  cloneUrl:        { type: String, requried: true },
  status:          { type: Number, default: 0 }, // 0: 未拉取，1: 拉取成功，2: 正在拉取
  create_at:       { type: Date, default: Date.now },
  update_at:       { type: Date, default: Date.now },
});

RepoSchema.plugin(BaseModel);
mongoose.model('Repo', RepoSchema);